package com.fh.config;

import com.fh.config.security.CustomAccessDeniedHandlerConfig;
import com.fh.config.security.CustomAuthenticationEntryPointConfig;
import com.fh.config.security.CustomAuthenticationFailureHandlerConfig;
import com.fh.config.security.CustomAuthenticationProviderConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;

/**
 * @author whf
 * @date 2024年10月24日 13:52
 */
@Configuration
public class SecurityBeanUtils {



    @Bean
    public AuthenticationProvider authenticationProvider() {
        return new CustomAuthenticationProviderConfig();
    }

    @Bean
    public AuthenticationFailureHandler customAuthenticationFailureHandler() {
        return new CustomAuthenticationFailureHandlerConfig();
    }

    @Bean
    public AccessDeniedHandler accessDeniedHandler() {
        return new CustomAccessDeniedHandlerConfig();
    }

    @Bean
    public AuthenticationEntryPoint authenticationEntryPoint(){
        return new CustomAuthenticationEntryPointConfig();
    }



}
